import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/user',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/User.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Editor.vue'),
                    meta: { title: '编辑管理' }
                },
                {
                    path: '/author1',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/Author1.vue'),
                    meta: { title: '查询所有作者' }
                },
                {
                    path: '/author2',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Author2.vue'),
                    meta: { title: '查询签约作者' }
                },
				{
				    path: '/author3',
				    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Author3.vue'),
				    meta: { title: '查看申请签约的作者' }
				},
                {
                    // 拖拽列表组件
                    path: '/book1',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/Book1.vue'),
                    meta: { title: '查询所有作品' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/book2',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/Book2.vue'),
                    meta: { title: '精选作品管理' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
